import requests
from bs4 import BeautifulSoup
# header = {
#     "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36",
#     "cookie": "bsource=search_baidu; _uuid=4E962068-04C3-4FCE-4C59-4353BEC87A9652637infoc; buvid3=DAF5E8D0-5B6C-4DC4-A2C0-75D1B87CA0B313431infoc"
# }
# url = "https://www.iqiyi.com/"
# html = requests.get(url,headers = header)
# file = open("html.txt","a+",encoding="utf-8")
# file.write(html.text)
# file.close()

file = open("html.txt","r",encoding="utf-8")
html = file.read()
file.close()

soup = BeautifulSoup(html,"html.parser")
titles = soup.select(".qy20-h-carousel__link")
for title in titles:
    print(title["href"])